<?php

class JSCasts_FrontController
{
    /**
     * The incoming Request
     *
     * @var JSCasts_Request
     */
    private static $Request;
    
    /**
     * The Route instance
     *
     * @var JSCasts_Path_Route
     */
    private static $Route;
    
    private static $Controller;
    private static $View;
    
    public static function configure($defaultController, $defaultAction)
    {
        
        JSCasts::load('Request');
        JSCasts::load('Path_Route');
        
        self::$Request = new JSCasts_Request;
        
        // Try to get the PATH_INFO from the Request instance, but if there was
        // none, just use the default.
        $pathInfo = self::$Request->pathInfo() 
            or $pathInfo = $defaultController;
        
        self::$Route = new JSCasts_Path_Route($pathInfo);
    }
    
    public static function respond()
    {
        die(self::$Route);
    }
}